<template>
  <el-card class="box-card" shadow="hover" :body-style="{ padding: '0' }" style="min-height: 322px;">
    <template #header>
      <div class="flex-between">
        <div class="wrap-title" :class="[colorType]">
          <span>{{data.name}}</span>
        </div>
        <span class="rjfl-more" @click="gotoRouter('/game/mobile-index.html',$router,{ param: '384_407_'+data.id+'_1' },'game-mobile-index')"
          >更多
          
        </span>
      </div>
    </template>
    <div class="list">
      <div class="item" v-for="item in data.data" :key="item.id" @click="gotoDetail(item,router)">
        <img :src="item.icon" alt="">
        <div>
          <span>{{item.name}}</span>
        </div>
      </div>
    </div> 
  </el-card>
</template>

<script setup>
import { ref } from "vue";
import { useRoute, useRouter } from "vue-router";
const router = ref(useRouter());

defineProps({
  data: {
    type: Object,
    default: () => {},
  },
  colorType: {
    type: String,
    default: () => 'orange'
  }
});

// const it = ref({
//   name: "梦想世界",
//   icon: "https://placeholder.idcd.com/?w=72&h=72&text=72x72",
//   id: "",
// });
</script>

<style lang="less" scoped>
.el-card ::v-deep(.el-card__header) {
  padding: 0;
}
.box-card {
  min-width: 348px;
  border-radius: 8px;
  .orange {
    background: linear-gradient(221deg, #FFCD4C 0%, #FF9A32 100%);
  }
  .blue {
    background: linear-gradient(215deg, #65C6FC 0%, #3594F8 100%);
  }
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wrap-title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 52px;
  border-radius: 8px 4px 20px 4px;
  span { 
    font-size: 20px;
    font-family: PingFangSC-Semibold, PingFang SC;
    font-weight: 600;
    color: #FFFFFF;
    line-height: 20px;
  }
}
.rjfl-more {
  font-size: 16px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #545759;
  line-height: 16px;
  cursor: pointer;
  margin-right: 20px;
}

.list {
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  .item {
    width:117.5px;
    height:136px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    // &:not(:nth-child(5n)) {
    //   margin-right: 30px;
    // }
    &:hover {
      span {
        color: @link-color;
      }
      img {
        opacity: 0.6;
      }
    }
    img { 
      width: 72px;
      height: 72px;
      margin: auto;
      border-radius: 8px;
    }
    span { 
      font-size: 16px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #1D2127;
      line-height: 16px;
    }
  }
}
</style>
